<!DOCTYPE html>

<html>

<head>

    <title>{$site_name}-会员充值</title>

    <meta name="keywords" content="{$site_seo_keywords}" />

    <meta name="description" content="{$site_seo_description}">

    <style type="text/css">
        #two-con{
            width: 700px;
        }

        #two-con .control-label {
            float: left;
            width: 90px;
            padding-top: 5px;
            text-align: right;
        }
        #two-con input.span4{
            width: 200px;
        }
        #two-con select{
            height: 34px;
            line-height: 34px;
        }
        #two-con select.span4{
            width: 214px;
        }
        /*tips*/
        #two-con .help-inline {
            display: block;
            margin-bottom: -20px;
            *zoom: 1;
            font-size: 14px;
        }
        #two-con .controls {
            *display: inline-block;
            *padding-left: 20px;
            margin-left: 110px;
            *margin-left: 0
        }
        .reposition{
            width: 350px;
            float: left;
        }
        #btn-order-print{
            padding-left: 10px;
            display: inline-block;
            height: 20px;
            text-decoration: none;
        }
        input[type="checkbox"] {
            margin: 0px !important;
        }
    </style>

    <tc_include file="Public:head" />

</head>

<body class="body-white" id="top">

<tc_include file="Public:nav" />

<div class="container tc-main">

    <div class="row">

        <div class="span2">

            <tc_include file="Public:usernav"/>

        </div>

        <div class="span10">
            <h3 style="margin-left:280px;margin-top:-10px;color: #ff0000;">{$menu_name}</h3>

            <if condition="$cardnum">
                <form class="form-horizontal" id="dd" action="{:leuu('User/Integral/doadd')}">
                    <input type="hidden" value="{$userinfo.cardnum}" name="cardnum">
                    <input type="hidden" name="tel" value="{$userinfo.tel}">
                    <input type="hidden" value="{$userinfo.name}" name="name">

                    <!-- 需要把之前的床位信息带过来，进行减去， -->
                    <input type="hidden" value="{$userinfo.usetime}" name="usetime">
                    <input type="hidden" value="{$userinfo.integral}" name="oldintegral">

                   <div class="control-group">
                       <label class="control-label" for="integral"><span style="color: red;">*</span>积分:</label>
                       <div class="controls">
                           <input type="number" id = "integral"  name="integral" class="span4">
                       </div>
                   </div>

                    <div class="control-group">
                        <label class="control-label" for="remark">备注:</label>
                        <div class="controls">
                            <textarea  id="remark" name="remark" style="width: 355px;height: 70px;"></textarea>
                            <span class="help-inline"></span>
                        </div>
                    </div>

                    <div class="control-group" style="margin-top: 20px;">


                        <div class="controls">
                            <button class="btn btn-primary js-ajax-submit span4" type="button" style="margin-left: 0px" id="subbtn">确定</button>
                        </div>
                    </div>
                </form>

                <hr>

                <div id="two-con" style="margin-left: 70px">
                    <div>
                        <div class="control-group reposition">
                            <label class="control-label"><span style="color: red;">*</span>服务卡号:</label>
                            <div class="controls">
                                <input type="text" value="{$userinfo.cardnum}" disabled name="cardnum" class="span4" id="vipcardnum">
                            </div>
                        </div>

                        <div class="control-group reposition">
                            <label class="control-label" >现有积分:</label>
                            <div class="controls">
                                <input type="text" name="uintegral" disabled value="{$userinfo['integral']/100}" class="span4" >
                                <div style="clear: both;"></div>
                            </div>
                        </div>
                        <div class="control-group reposition">
                            <label class="control-label" >姓名:</label>
                            <div class="controls">
                                <input type="text" id="name" name="uname" disabled value="{$userinfo.name}" class="span4" >
                                <div style="clear: both;"></div>
                            </div>
                        </div>
                        <div class="control-group reposition">
                            <label class="control-label" >电话:</label>
                            <div class="controls">
                                <input type="text" id="utel" name="utel" disabled value="{$userinfo.tel}" class="span4" >
                                <div style="clear: both;"></div>
                            </div>
                        </div>

                        <div style="clear: both"></div>
                        <else/>
                        <div>
                            <form action="{:leuu('User/Integral/add')}" style="margin: 90px 0 0 20px;">
                                请输入会员卡号：<input name="cardnum" type="number">
                                <input type="submit" class="btn" style="vertical-align:top;">
                            </form>
                        </div>
                    </div>

                </div>
            </if>


        </div>

    </div>

</div>

<!-- /container -->

<tc_include file="Public:scripts" />

<script src="__PUBLIC__/js/tools.js?num=1.2"></script>
<script src="__PUBLIC__/js/jquery.print.js"></script>
<script type="text/javascript">
    $('#subbtn').click(function() {
        $.post("{:leuu('User/Integral/doadd')}",$('#dd').serialize(),function(data){
            document.getElementById('subbtn').disabled=true;
            if(data.status == 1) {
                if(data.url) {
                    window.location.href=data.url;
                } else {
                    location.reload();
                }
            } else {
                alert(data.info);
                document.getElementById('subbtn').disabled=false;
            }
        })
    });

    function changeStore(num) {
        var strOutput =  GetNumberForChinese(num);
        $('#storedmoneystr').html(strOutput);
    }

    function changeStoreSend(num) {
        var strOutput =  GetNumberForChinese(num);
        $('#storedsendmoneystr').html(strOutput);
    }
</script>

</body>

</html>